import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;



public class Main {
	
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		StringTokenizer sToken = new StringTokenizer(str, " ");
		int n = Integer.parseInt(sToken.nextToken());
		long a = Long.parseLong(sToken.nextToken());
		long b = Long.parseLong(sToken.nextToken());
		List<Long> l = new ArrayList<Long>();
		
		while(n-- != 0) {
			l.add(Long.parseLong(br.readLine().trim()));
		}
		
		long startTime = System.currentTimeMillis();
				
		
		List<Long> l1 = divideList(l, 0, l.size() / 2);
		List<Long> l2 = divideList(l, l.size() / 2, l.size());
		
		List<Long> sum1 = populateSum(l1);
		List<Long> sum2 = populateSum(l2);
		Collections.sort(sum1);
		Collections.sort(sum2);
		
		long ans = 0;
		Long[] sumArray2 = sum2.toArray(new Long[0]);
		for(Long i : sum1) {
			int upperBound = upperBound(sumArray2, 0, sumArray2.length - 1, b - i);
			int lowerBound = lowerBound(sumArray2, 0, sumArray2.length - 1, a - i);
			if(upperBound != -1 && lowerBound != -1 && upperBound >= lowerBound) {
				ans += (upperBound - lowerBound) + 1;
			}
		
		}
		System.out.println(ans);
		//System.out.println(System.currentTimeMillis() - startTime);
	}
	
	
	private static int lowerBound(Long[] l, int start, int end, long num) {
		int index = -1;
		while(start <= end) {
			int mid = (start + end) / 2;
			if(l[mid] >= num)  {
				end = mid - 1;
				index = mid;
			} else {
				start = mid + 1;
			}
		}
		return index;
	}
	
	private static int upperBound(Long[] l, int start, int end, long num) {
		int index = -1;
		while(start <= end) {
			int mid = (start + end) / 2;
			if(l[mid] <= num)  {
				start = mid + 1;
				index = mid;
			} else {
				end = mid - 1;
			}
		}
		return index;
	}

	
	private static List<Long> populateSum(List<Long> a) {
		List<Long> list = new ArrayList<Long>(1<<a.size());
//		for(int i = 0; i < (1<<a.size()); i++) {
//			long sum = 0;
//			for(int j = 0; j < a.size(); j++) {
//				int tmp = (1 << j) & i;
//				if(tmp != 0) {
//					sum += a.get(j);
//				}
//			}
//			list.add(sum);
//		}
		populateSumRecurse(a.toArray(new Long[0]), list);
		return list;
	}
	
	private static void populateSumRecurse(Long[] a, List<Long> sumCombination, Long currentSum, int index) {
		if(index >= a.length) {
			return;
		}
		for(int i = index; i < a.length; i++) {
			sumCombination.add(a[i] + currentSum );
			populateSumRecurse(a, sumCombination, a[i] + currentSum , i + 1);
		}
	}
	
	private static void populateSumRecurse(Long[] a, List<Long> sumCombination) {
		sumCombination.add(0L);
		populateSumRecurse(a, sumCombination, 0L, 0);
	}
	
//	public static void main(String[] str) {
//		Long[] l = new Long[] {0L, 1L, 2L, 3L, 4L};
//		List<Long> sumeCombi = new ArrayList<Long>();
//		
//		populateSumRecurse(l, sumeCombi);
//		System.out.println(sumeCombi.size());
//		System.out.println(sumeCombi);
//	}
//	
	private static List<Long> divideList(List<Long> a, int start, int end) {
		return a.subList(start, end);
	}
	
}